package com.hxkj.service.analyze.impl;

import com.hxkj.client.service.GeneratorStaticFileServiceClient;
import com.hxkj.domain.po.FreeMarker;
import com.hxkj.service.analyze.CreatedFreeMakerSerivice;
import com.platform.common.domain.exception.CustomMessageException;
import com.platform.common.domain.result.ResultMessageStruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/****
 *  一鍵生成静态模板
 *
 * ****/
@Service
@Slf4j
public class CreatedFreeMakerSeriviceImpl implements CreatedFreeMakerSerivice {

    @Autowired
    private GeneratorStaticFileServiceClient generatorStaticFileServiceClient;

    @Override
    public void createSiteAll(FreeMarker freeMarker) throws Exception {
        ResultMessageStruct result = generatorStaticFileServiceClient.createSiteAll(freeMarker);
        if(200 != result.getCode()){
            throw new CustomMessageException(result.getCode(),result.getMessage());
        }
    }
}
